package servicesimp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import bean.Message;
import mapper.mapperoptions;
import serviceinterface.interfaceoptions;

public class lmpoptions implements interfaceoptions {

	@Autowired
	private mapperoptions mapperoptions;
	

	public String shan(Message m) {
		mapperoptions.shan(m);
		return "ok";
	}

	public String zhuce(Message m) {
		try {
			mapperoptions.zhuce(m);
			System.out.println("注册成功");
			return "ok";
		} catch (Exception e) {
			return "no";
		}
			
		
	}

	public Message denglu(Message m) {
		try {
			Message userMessage=mapperoptions.denglu(m);
			userMessage.getEmail();
			System.out.println(userMessage.getName()+"已成功登陆");
			return userMessage ;
		} catch (Exception e) {
			System.out.println("密码不正确");
			return null;
		}
		
	}

	public String baoming(Message m) {
		mapperoptions.baoming(m);
		
		return "ok";
	}

	public List<Message> find(Message m) {
		
		return mapperoptions.find(m);
	}


	public String xiugai(Message m) {
		mapperoptions.xiugai(m);
		return null;
	}


	public int count(Message m) {
		
		return mapperoptions.count(m);
	}


	public Message gerenfind(Message m) {
		
		return mapperoptions.dangefind(m);
	}

}
